﻿using System;
using System.Runtime.Serialization;

namespace EzDesk.Apps.Model.Attendance
{
    /// <summary>
    /// 描述一个简单的时间
    /// </summary>
    [DataContract]
    public class SimpleTime
    {
        [DataMember]
        public int Hour { get; set; }

        [DataMember]
        public int Miniute { get; set; }

        public DateTime ToDateTime(DateTime date)
        {
            return new DateTime(
                date.Year,
                date.Month,
                date.Day,
                Hour,
                Miniute,
                0
                );
        }

        public DateTime ToDateTime()
        {
            return ToDateTime(DateTime.Today);
        }
    }
}